import { createSvgIconsPlugin } from 'vite-plugin-svg-icons';
import { PlatformPath } from 'path';

export default (path: PlatformPath, isBuild: boolean) => {
  return createSvgIconsPlugin({
    // specify the folder to cache icons
    iconDirs: [path.resolve(path.resolve(__dirname, '../../src'), 'assets/icons/svg')],
    // specify the symbol id format
    symbolId: 'icon-[dir]-[name]',
    svgoOptions: isBuild
  });
};
